<?php
	/* Description: This file is used to add sub sub category. */
	#########IncludeFiles####################################################################################
	include_once '../inc/config.php';
	include_once("../inc/bootstrape.php");
	require_once _SITE_PATH_.'classes/Vendor/Vendor.php';
	require_once _SITE_PATH_.'classes/Master/Master.php';
	require_once _SITE_PATH_.'classes/CommonUtility/CommonUtility.php';

	$id = trim($_REQUEST['id']); 

	if( $_POST['submit']=='Submit'){ 
		$parms['id'] = $_POST['id'];
		$parms['country_id'] = $_POST['country_id'];
		$parms['state_id'] = $_POST['state_id'];
		$parms['name'] = $_POST['name'];
			
		$condition['id'] = $parms['id'];
		if( CommonUtility::updateData($parms, 'city_master',$condition)) {        
			header("Location: city_mng.php?msg=1424");            
			exit;
		}
		$err = 1425;    
	}

	$cities = array();
	$cities = Master::getCitiesList($id);
	$result = $cities[0];
		
	$dropdown_countries = array();
	$dropdown_countries = CommonUtility::getCountry($result['country_id']);

	$dropdown_states = array();
	$dropdown_states = CommonUtility::getState($result['country_id'],$result['state_id']);

	$errMsg = $err;
	$_tplName = 'master/city_edit.tpl';
	$_title = 'Edit City';

	require_once _ADMIN_TPL_MAIN_;
?>